import { serviceConfig, tiandituKeys } from '@/../service.config'

const mode = import.meta.env.MODE
const { url: ISERVER_URL } = serviceConfig[mode]
const { key: TIANDITU_KEY } = tiandituKeys[mode]

export const URL_CONFIGS = {
  // 德阳 rest 地图服务地址
  DY_MAP_URL: `${ISERVER_URL}/iserver/services/map-dy/rest/maps/dy`,
  // 德阳 rest 地图图例
  DY_MAP_LEGEND_URL: `${ISERVER_URL}/iserver/services/map-dy/rest/maps/dy/legend.json?returnVisibleOnly=false&bbox=98.62%2C25.2%2C110.63%2C37.2`,
  // 德阳 rest 数据服务
  DY_DATA_URL: `${ISERVER_URL}/iserver/services/data-dy/rest/data`,
  // 四川景点数据
  JINGDIAN_DATA_URL: `${ISERVER_URL}/iserver/services/data-SiChuan/rest/data/featureResults.geojson?returnContent=true`,
  // 四川 DEM WMTS服务
  DEM_URL: `${ISERVER_URL}/iserver/services/map-dy/wmts100?layer=dem&style=default&tilematrixset=GoogleCRS84Quad_dem&Service=WMTS&Request=GetTile&Version=1.0.0&Format=image/png&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}`,
  // 天地图矢量地图
  VEC_TIANDITU_URL: `http://t0.tianditu.com/vec_c/wmts?tk=${TIANDITU_KEY}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=vec&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles`,
  // 天地图注记地图
  CVA_TIANDITU_URL: `http://t0.tianditu.com/cva_c/wmts?tk=${TIANDITU_KEY}&SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=cva&STYLE=default&TILEMATRIXSET=c&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&FORMAT=tiles`,
  DOY_DATA_URL: 'https://iclient.supermap.io/web/data/L7/4472780b-fea1-4fc2-9e4b-3ca716933dc7.json',
  FLYLINE_DATA_URL: 'https://iclient.supermap.io/web/data/L7/a5ac7bce-181b-40d1-8a16-271356264ad8.json',
  // 成都矢量瓦片地图
  CHENGDU_MAP_URL: `${ISERVER_URL}/iserver/services/map-SiChuan/restjsr/v1/vectortile/maps/chengdu/style.json?type=MapBox_GL&styleonly=true`,
  // 四川影像服务地址
  SICHUAN_IMAGESERVICE_URL: `${ISERVER_URL}/iserver/services/imageservice-sichuan/restjsr`,
  // 四川 rest 数据服务
  SICHUAN_DATA_URL: `${ISERVER_URL}/iserver/services/data-SiChuan/rest/data/featureResults.geojson?returnContent=true`,
  // 二维管网 rest 地图服务地址
  PIPE_MAP_URL: `${ISERVER_URL}/iserver/services/map-burst/rest/maps/pipe`,
  // 二维管网 rest 数据服务地址
  PIPE_DATA_URL: `${ISERVER_URL}/iserver/services/data-burst/rest/data/featureResults.geojson?returnContent=true`,
  // 管网网络分析服务地址
  PIPE_ANALYSIS_URL: `${ISERVER_URL}/iserver/services/transportationAnalyst-burst/rest/networkanalyst/burstdata_Network@pipe`,
  // 路径规划服务
  ROUTE_PLANNING_URL: `${ISERVER_URL}/iserver/services/transportationAnalyst-SiChuan/rest/networkanalyst/SiChuan_Network@SiChuan/path.json`,
  // 地图打印服务
  MAP_PRINT_URL: `${ISERVER_URL}/iserver/services/webprinting/rest/webprinting/v1/jobs.rjson`
}
